<?php
namespace App\Http\Controllers\Admin;
use App\Models\Recharge;
/**
 * TestGuest Version1.0
 * ================================================
 * Copy 2017-2018 zxj
 * Web: http://www.zhaoxiaojie.club
 * ================================================
 * Author: Zxj
 * Date: 17/9/5
 * Time: 上午9:18
 *
 * 后台充值订单管理控制器
 *
 */
class OrderController extends BaseController{
    public function __construct(Recharge $recharge)
    {
        parent::__construct();
        $this->recharge = $recharge; // 注入充值模型
    }


    // 充值订单页
    public function getIndex(){

        $flag = 'charge';
        $data = $this->recharge->getOrderList(request());   //充值订单数据
        //dd($data);
        return view('admin.recharge.order_list',compact('flag','data'));

    }

    //ajax改变到账状态(充值订单管理)
    public function postChange(){

        //dd($_POST['id']);
        //dd(request('id'));

        $ajaxData = $this->recharge->changeOrderStatus(request());
        echo json_encode($ajaxData);

    }



}